import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
// import staticText from './components/staticText'
// Vue.component('staticText',staticText)

//https://blog.csdn.net/sayoko06/article/details/85050257
// 把 /components 目录下的组件统一注册
const requireComponent=require.context('./components',false,/.vue/)
requireComponent.keys().forEach(fileName=>{
  const cfg=requireComponent(fileName)
  const compName=fileName.replace(/^\.\/(.*)\.\w+$/,'$1')
  // console.log('注册组件',compName);
  Vue.component(compName,cfg.default|| cfg)
})

Vue.use(ElementUI);
Vue.config.productionTip = false

new Vue({
  router,
  store,  
  render: h => h(App)
}).$mount('#app')
